<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: common/include/pcl/common/distances.h 文件参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('common_2include_2pcl_2common_2distances_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">distances.h 文件参考<div class="ingroups"><a class="el" href="group__common.html">Common components</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;<a class="el" href="common_2include_2pcl_2common_2common_8h_source.html">pcl/common/common.h</a>&gt;</code><br />
</div>
<p><a href="common_2include_2pcl_2common_2distances_8h_source.html">浏览源代码.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:ga4ee346a92c01c042ffae2907ae5c93c5"><td class="memItemLeft" align="right" valign="top">PCL_EXPORTS void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga4ee346a92c01c042ffae2907ae5c93c5">pcl::lineToLineSegment</a> (const Eigen::VectorXf &amp;line_a, const Eigen::VectorXf &amp;line_b, Eigen::Vector4f &amp;pt1_seg, Eigen::Vector4f &amp;pt2_seg)</td></tr>
<tr class="memdesc:ga4ee346a92c01c042ffae2907ae5c93c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the shortest 3D segment between two 3D lines  <a href="group__common.html#ga4ee346a92c01c042ffae2907ae5c93c5">更多...</a><br /></td></tr>
<tr class="separator:ga4ee346a92c01c042ffae2907ae5c93c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gad9217ecd4cc14221f178af07a16ef75d"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#gad9217ecd4cc14221f178af07a16ef75d">pcl::sqrPointToLineDistance</a> (const Eigen::Vector4f &amp;pt, const Eigen::Vector4f &amp;line_pt, const Eigen::Vector4f &amp;line_dir)</td></tr>
<tr class="memdesc:gad9217ecd4cc14221f178af07a16ef75d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the square distance from a point to a line (represented by a point and a direction)  <a href="group__common.html#gad9217ecd4cc14221f178af07a16ef75d">更多...</a><br /></td></tr>
<tr class="separator:gad9217ecd4cc14221f178af07a16ef75d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3d6aa7accd68832e8a4d4707c358e40f"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__common.html#ga3d6aa7accd68832e8a4d4707c358e40f">pcl::sqrPointToLineDistance</a> (const Eigen::Vector4f &amp;pt, const Eigen::Vector4f &amp;line_pt, const Eigen::Vector4f &amp;line_dir, const double sqr_length)</td></tr>
<tr class="memdesc:ga3d6aa7accd68832e8a4d4707c358e40f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the square distance from a point to a line (represented by a point and a direction)  <a href="group__common.html#ga3d6aa7accd68832e8a4d4707c358e40f">更多...</a><br /></td></tr>
<tr class="separator:ga3d6aa7accd68832e8a4d4707c358e40f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga30ceb9b4896578ed075a36ad3937ee26"><td class="memTemplParams" colspan="2">template&lt;typename PointT &gt; </td></tr>
<tr class="memitem:ga30ceb9b4896578ed075a36ad3937ee26"><td class="memTemplItemLeft" align="right" valign="top">double&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__common.html#ga30ceb9b4896578ed075a36ad3937ee26">pcl::getMaxSegment</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;cloud, <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;pmin, <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;pmax)</td></tr>
<tr class="memdesc:ga30ceb9b4896578ed075a36ad3937ee26"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtain the maximum segment in a given set of points, and return the minimum and maximum points.  <a href="group__common.html#ga30ceb9b4896578ed075a36ad3937ee26">更多...</a><br /></td></tr>
<tr class="separator:ga30ceb9b4896578ed075a36ad3937ee26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1794862c1f52bfb188d6a4b48a2a5f4b"><td class="memTemplParams" colspan="2">template&lt;typename PointT &gt; </td></tr>
<tr class="memitem:ga1794862c1f52bfb188d6a4b48a2a5f4b"><td class="memTemplItemLeft" align="right" valign="top">double&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__common.html#ga1794862c1f52bfb188d6a4b48a2a5f4b">pcl::getMaxSegment</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;cloud, const std::vector&lt; int &gt; &amp;indices, <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;pmin, <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &amp;pmax)</td></tr>
<tr class="memdesc:ga1794862c1f52bfb188d6a4b48a2a5f4b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Obtain the maximum segment in a given set of points, and return the minimum and maximum points.  <a href="group__common.html#ga1794862c1f52bfb188d6a4b48a2a5f4b">更多...</a><br /></td></tr>
<tr class="separator:ga1794862c1f52bfb188d6a4b48a2a5f4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28ecc173df18d9175dee9f4dd042390b"><td class="memTemplParams" colspan="2">template&lt;typename PointType1 , typename PointType2 &gt; </td></tr>
<tr class="memitem:a28ecc173df18d9175dee9f4dd042390b"><td class="memTemplItemLeft" align="right" valign="top">float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="common_2include_2pcl_2common_2distances_8h.html#a28ecc173df18d9175dee9f4dd042390b">pcl::squaredEuclideanDistance</a> (const PointType1 &amp;p1, const PointType2 &amp;p2)</td></tr>
<tr class="memdesc:a28ecc173df18d9175dee9f4dd042390b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the squared euclidean distance between the two given points.  <a href="common_2include_2pcl_2common_2distances_8h.html#a28ecc173df18d9175dee9f4dd042390b">更多...</a><br /></td></tr>
<tr class="separator:a28ecc173df18d9175dee9f4dd042390b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acce728864fe6aa3af8783cb0a963a4b1"><td class="memItemLeft" align="right" valign="top">template&lt;&gt; </td></tr>
<tr class="memitem:acce728864fe6aa3af8783cb0a963a4b1"><td class="memTemplItemLeft" align="right" valign="top">float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="common_2include_2pcl_2common_2distances_8h.html#acce728864fe6aa3af8783cb0a963a4b1">pcl::squaredEuclideanDistance</a> (const PointXY &amp;p1, const PointXY &amp;p2)</td></tr>
<tr class="memdesc:acce728864fe6aa3af8783cb0a963a4b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the squared euclidean distance between the two given points.  <a href="common_2include_2pcl_2common_2distances_8h.html#acce728864fe6aa3af8783cb0a963a4b1">更多...</a><br /></td></tr>
<tr class="separator:acce728864fe6aa3af8783cb0a963a4b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73e1d23717813eb053a0eb51411a4a23"><td class="memTemplParams" colspan="2">template&lt;typename PointType1 , typename PointType2 &gt; </td></tr>
<tr class="memitem:a73e1d23717813eb053a0eb51411a4a23"><td class="memTemplItemLeft" align="right" valign="top">float&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="common_2include_2pcl_2common_2distances_8h.html#a73e1d23717813eb053a0eb51411a4a23">pcl::euclideanDistance</a> (const PointType1 &amp;p1, const PointType2 &amp;p2)</td></tr>
<tr class="memdesc:a73e1d23717813eb053a0eb51411a4a23"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the euclidean distance between the two given points.  <a href="common_2include_2pcl_2common_2distances_8h.html#a73e1d23717813eb053a0eb51411a4a23">更多...</a><br /></td></tr>
<tr class="separator:a73e1d23717813eb053a0eb51411a4a23"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>Define standard C methods to do distance calculations </p>
</div><h2 class="groupheader">函数说明</h2>
<a id="a73e1d23717813eb053a0eb51411a4a23"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a73e1d23717813eb053a0eb51411a4a23">&#9670;&nbsp;</a></span>euclideanDistance()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointType1 , typename PointType2 &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float pcl::euclideanDistance </td>
          <td>(</td>
          <td class="paramtype">const PointType1 &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const PointType2 &amp;&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the euclidean distance between the two given points. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>the first point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p2</td><td>the second point </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;  {</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    <span class="keywordflow">return</span> (std::sqrt (squaredEuclideanDistance (p1, p2)));</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<a id="a28ecc173df18d9175dee9f4dd042390b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28ecc173df18d9175dee9f4dd042390b">&#9670;&nbsp;</a></span>squaredEuclideanDistance() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointType1 , typename PointType2 &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float pcl::squaredEuclideanDistance </td>
          <td>(</td>
          <td class="paramtype">const PointType1 &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const PointType2 &amp;&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the squared euclidean distance between the two given points. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>the first point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p2</td><td>the second point </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;  {</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;    <span class="keywordtype">float</span> diff_x = p2.x - p1.x, diff_y = p2.y - p1.y, diff_z = p2.z - p1.z;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <span class="keywordflow">return</span> (diff_x*diff_x + diff_y*diff_y + diff_z*diff_z);</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
<a id="acce728864fe6aa3af8783cb0a963a4b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acce728864fe6aa3af8783cb0a963a4b1">&#9670;&nbsp;</a></span>squaredEuclideanDistance() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">float pcl::squaredEuclideanDistance </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y.html">PointXY</a> &amp;&#160;</td>
          <td class="paramname"><em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structpcl_1_1_point_x_y.html">PointXY</a> &amp;&#160;</td>
          <td class="paramname"><em>p2</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Calculate the squared euclidean distance between the two given points. </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">p1</td><td>the first point </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">p2</td><td>the second point </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;  {</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    <span class="keywordtype">float</span> diff_x = p2.x - p1.x, diff_y = p2.y - p1.y;</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    <span class="keywordflow">return</span> (diff_x*diff_x + diff_y*diff_y);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  }</div>
</div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_bdd9a5d540de89e9fe90efdfc6973a4f.html">common</a></li><li class="navelem"><a class="el" href="dir_11fbc4217d50ab21044e5ad6614aede5.html">include</a></li><li class="navelem"><a class="el" href="dir_39ef148c3cf3468c290ae8c03b3c03af.html">pcl</a></li><li class="navelem"><a class="el" href="dir_474708a720ff06817ce2c12e28baf137.html">common</a></li><li class="navelem"><a class="el" href="common_2include_2pcl_2common_2distances_8h.html">distances.h</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
